<?php if (!defined('THINK_PATH')) exit(); /*a:5:{s:80:"D:\phpStudy\WWW\huanhuizhangwu\public/../application/admin\view\public\left.html";i:1557301393;s:84:"D:\phpStudy\WWW\huanhuizhangwu\public/../application/admin\view\role\updaterole.html";i:1557328660;s:72:"D:\phpStudy\WWW\huanhuizhangwu\application\admin\view\public\layout.html";i:1557300144;s:69:"D:\phpStudy\WWW\huanhuizhangwu\application\admin\view\public\top.html";i:1557300262;s:70:"D:\phpStudy\WWW\huanhuizhangwu\application\admin\view\public\left.html";i:1557301393;}*/ ?>
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>换汇账务系统--<?php echo $title; ?></title>
        <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="description" content="">
        <meta name="author" content="">
        <link rel="stylesheet" type="text/css" href="/static/home/lib/bootstrap/css/bootstrap.css">

        <link rel="stylesheet" type="text/css" href="/static/home/stylesheets/theme.css">
        <link rel="stylesheet" href="/static/home/lib/font-awesome/css/font-awesome.css">

        <script src="/static/home/lib/jquery-1.7.2.min.js" type="text/javascript"></script>
        <script type="text/javascript" src="/static/layer/layer.js"></script>
        <script src="/static/laydate/laydate.js"></script>

        <!-- Demo page code -->

        <style type="text/css">
            #line-chart {
                height:300px;
                width:800px;
                margin: 0px auto;
                margin-top: 1em;
            }
            .brand { font-family: georgia, serif; }
            .brand .first {
                color: #ccc;
                font-style: italic;
            }
            .brand .second {
                color: #fff;
                font-weight: bold;
            }
        </style>

        <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
        <!--[if lt IE 9]>
          <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
        <![endif]-->


    </head>

    <!--[if lt IE 7 ]> <body class="ie ie6"> <![endif]-->
    <!--[if IE 7 ]> <body class="ie ie7 "> <![endif]-->
    <!--[if IE 8 ]> <body class="ie ie8 "> <![endif]-->
    <!--[if IE 9 ]> <body class="ie ie9 "> <![endif]-->
    <!--[if (gt IE 9)|!(IE)]><!--> 
    <body class=""> 
        <!--<![endif]-->

        <div class="navbar">
    <div class="navbar-inner">
        <ul class="nav pull-right">

            <!--            <li><a href="#" class="hidden-phone visible-tablet visible-desktop" role="button">Settings</a></li>-->
            <li id="fat-menu" class="dropdown">
                <a href="#" role="button" class="dropdown-toggle" data-toggle="dropdown">
                    <i class="icon-user"></i> <?php echo \think\Request::instance()->session('u_username'); ?>
                    <i class="icon-caret-down"></i>
                </a>

                <ul class="dropdown-menu">
                    <!--                    <li><a tabindex="-1" href="#">My Account</a></li>-->
                    <!--                    <li class="divider"></li>-->
                    <li><a tabindex="-1" class="visible-phone" href="#"> <?php echo \think\Request::instance()->session('u_username'); ?></a></li>
                    <li class="divider visible-phone"></li>
                    <li class="logout"><a tabindex="-1" style="cursor: pointer">退出</a></li>
                </ul>
            </li>

        </ul>
        <a class="brand" href="<?php echo url('/admin/Index'); ?>"><span class="second">换汇账务系统</span></a>
    </div>
</div>
<script>
    $(".logout").click(function () {

        layer.confirm('确认退出吗？', {
            btn: ['确认', '取消'] //按钮
        }, function (index) {

            layer.close(index);

            layer.load(1, {
                shade: [0.2, '#fff'], //0.1透明度的白色背景
                time: 1000
            });
            setTimeout(function () {
                window.location.href = "<?php echo url('/admin/Index/logout'); ?>";//注销登录
            }, 1000);


//            layer.msg('的确很重要', {icon: 1});
        }, function () {

//            layer.msg('也可以这样', {
//                time: 20000, //20s后自动关闭
//                btn: ['明白了', '知道了']
//            });
        });



    });
</script>


               
<div class="sidebar-nav">
    <form class="search form-inline">
      <?php
      $cue = session("cue");
      $pid = db("auth")->where("auth_name='$cue'")->value("auth_pid");  
      $a = cookie("think_var");
      ?>
    </form>


    <?php if(is_array($onelist) || $onelist instanceof \think\Collection || $onelist instanceof \think\Paginator): $i = 0; $__LIST__ = $onelist;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$one): $mod = ($i % 2 );++$i;?>
    <a href="#<?php echo $one['auth_id']; ?>" class="nav-header" data-toggle="collapse"><i class="<?php echo $one['auth_icon']; ?>"></i><?php echo $one['auth_name']; ?><i class="icon-chevron-up"></i></a>
    
    <ul id="<?php echo $one['auth_id']; ?>" class="nav nav-list collapse <?php if($pid==$one['auth_id']): ?>in<?php endif; ?>">
        <?php if(is_array($twolist) || $twolist instanceof \think\Collection || $twolist instanceof \think\Paginator): $i = 0; $__LIST__ = $twolist;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$two): $mod = ($i % 2 );++$i;if($two['auth_pid']==$one['auth_id']): ?>
        <li class="<?php if($two['auth_name']==$cue): ?>active<?php else: endif; ?>"><a href="/<?php echo $two['auth_a']; ?>"><?php echo $two['auth_name']; ?></a></li>
        <?php endif; endforeach; endif; else: echo "" ;endif; ?>
    </ul>
    
    <?php endforeach; endif; else: echo "" ;endif; ?>
</div>

        

<div class="content">

    <div class="header">

        <h1 class="page-title"><?php echo \think\Lang::get('xiugaiquanxian'); ?></h1>
    </div>

    <ul class="breadcrumb">
        <li><a href="#"><?php echo \think\Lang::get('wangzhanguanli'); ?></a> <span class="divider">/</span></li>


        <li><a href="<?php echo url('Role/manage'); ?>"><?php echo \think\Lang::get('quanxianguanli'); ?></a><span class="divider">/</span></li>

        <li class="active"><?php echo \think\Lang::get('xiugaiquanxian'); ?></li>

    </ul>

    <div class="container-fluid">
        <div class="row-fluid">

            <div class="btn-toolbar">
                &nbsp;
                <!--                <a href="#myModal" data-toggle="modal1" class="btn">Delete</a>-->
                <div class="btn-group">
                </div>
            </div>
            <div class="well" style="margin-top: -15px;">
                <!--                <ul class="nav nav-tabs">
                                    <li class="active"><a href="#home" data-toggle="tab">个人信息</a></li>
                                    <li><a href="#profile" data-toggle="tab">修改密码</a></li>
                                </ul>-->
                <div id="myTabContent" class="tab-content">
                    <div class="tab-pane active in" id="home">
                        <form id="form2" name="form" method="post" enctype="multipart/form-data" onsubmit="return false">




                            <label><?php echo \think\Lang::get('quanxianmingcheng'); ?>：</label>
                            <input  name="r_name" type="text" value="<?php echo $list['r_name']; ?>" class="input-xlarge" style="width: 200px;">
                            <input name="r_id" type="hidden" value="<?php echo $list['r_id']; ?>">



                            <label><?php echo \think\Lang::get('xuanzequanxian'); ?>：</label>
                            <div style="">
                                <?php if(is_array($flist) || $flist instanceof \think\Collection || $flist instanceof \think\Paginator): $i = 0; $__LIST__ = $flist;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$flist): $mod = ($i % 2 );++$i;?>

                                <br/><input type="checkbox" class="authf" name="auth[]" value="<?php echo $flist['auth_id']; ?>" <?php if(in_array($flist['auth_id'],$marr)): ?>checked='checked'<?php endif; ?>>&nbsp;<b><?php if($a=='zh-cn'): ?><?php echo $flist['auth_name']; else: ?><?php echo $flist['auth_en']; endif; ?></b><br/>
                                <br/>

                                <?php if(is_array($zlist) || $zlist instanceof \think\Collection || $zlist instanceof \think\Paginator): $i = 0; $__LIST__ = $zlist;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;if($vo['auth_pid']==$flist['auth_id']): ?>
                                &nbsp;&nbsp;&nbsp;&nbsp;<input class="auth"  type="checkbox" name="auth[]" value="<?php echo $vo['auth_id']; ?>" <?php if(in_array($vo['auth_id'],$marr)): ?>checked='checked'<?php endif; ?>>&nbsp;<?php if($a=='zh-cn'): ?><?php echo $vo['auth_name']; else: ?><?php echo $vo['auth_en']; endif; ?><br/>
                                <br/>
                                <?php endif; endforeach; endif; else: echo "" ;endif; endforeach; endif; else: echo "" ;endif; ?>
                            </div>

                            <div>
                                &nbsp;<button class="btn btn-primary save1"><i class="icon-save"></i> <?php echo \think\Lang::get('baocun'); ?></button>
                            </div>
                        </form>
                        <script>
                            $(".auth").on("click", function () {
                                var aid = $(this).val();
                                if (!$(this).is(":checked"))
                                {




                                } else
                                {
                                    $.post("<?php echo url('Role/ajaxselects'); ?>", {aid: aid}, function (data) {


                                        $("input[class='authf'][value='" + data + "']").prop('checked', true);
                                        $("input[class='authf'][value='" + data + "']").prop('checked');

                                    });

                                }
                            })


                            $(".authf").on("click", function () {
                                var fid = $(this).val();

                                if (!$(this).is(":checked"))
                                {
                                    //alert("取消");

//取消选择
                                    $.post("<?php echo url('Role/ajaxselect'); ?>", {fid: fid}, function (data) {


                                        for (key in data) {
                                            var v = data[key]['auth_id']
                                            $("input[class='auth'][value='" + v + "']").removeProp('checked');
                                            $("input[class='auth'][value='" + v + "']").prop('checked');
                                        }

                                    });
                                } else
//选择
                                {
                                    // alert("选择");
                                    $.post("<?php echo url('Role/ajaxselect'); ?>", {fid: fid}, function (data) {


                                        for (key in data) {
                                            var v = data[key]['auth_id']
                                            $("input[class='auth'][value='" + v + "']").prop('checked', true);
                                            $("input[class='auth'][value='" + v + "']").prop('checked');
                                        }

                                    })
                                }
                            })


                        </script>

                        <script>
                            $(".save1").click(function () {
                                var formData = new FormData(document.getElementById("form2"));//表单id
                                $.ajax({
                                    type: "post",
                                    url: "<?php echo url('admin/Role/update'); ?>",
                                    data: formData,
                                    async: false,
                                    cache: false,
                                    contentType: false,
                                    processData: false,
                                    dataType: 'json',
                                    success: function (data) {

                                        if (data.status == 1)
                                        {
                                            layer.load(1, {
                                                shade: [0.1, ''], //0.1透明度的白色背景
                                                time: 500
                                            });
                                            setTimeout(function () {
                                                layer.msg(data.message, {time: 1000}, function () {
                                                    window.location.href = "<?php echo url('/manage'); ?>";
                                                });
                                            }, 500);
                                        } else
                                        {
                                            layer.load(1, {
                                                shade: [0.1, ''], //0.1透明度的白色背景
                                                time: 500
                                            });
                                            setTimeout(function () {
                                                layer.msg(data.message, {time: 1000}, function () {

                                                });
                                            }, 500);
                                        }
                                    }
                                })
                            })
                        </script>
                    </div>

                </div>

            </div>
            <footer>
                <hr>

                <p class="pull-right">Collect from <a href="#" title="网页模板" >sxddd</a></p>


                <p>&copy; 2019 <a href="#" >Portnine</a></p>
            </footer>

        </div>
    </div>

</div>


        <script src="/static/home/lib/bootstrap/js/bootstrap.js"></script>
        <script type="text/javascript">
            $("[rel=tooltip]").tooltip();
            $(function () {
                $('.demo-cancel-click').click(function () {
                    return false;
                });
            });
        </script>

    </body>
</html>


